using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ExitPanel : BasePanel
{
    static readonly string path = "UI/Panel/ExitPanel";
    public ExitPanel() : base(new UIType(path)) { }
    public override void OnEnter()
    {
        Time.timeScale = 0f;
        uitool.GetOrAddComponentInChildren<Button>("Exit").onClick.AddListener(() =>
        {
            panelmanager.PopAll();
            GameRoot.Instance.scenesystem.SetScene(new MapScene());
        });
        uitool.GetOrAddComponentInChildren<Button>("Return").onClick.AddListener(() =>
        {
            panelmanager.Pop();
        });
    }
    public override void OnExit()
    {
        Time.timeScale = 1f;
        base.OnExit();
    }
}
